﻿
namespace System.Collections.ObjectModel {
	public static class ObservableCollectionExtension {
		public static void MoveUpItem<T>(this ObservableCollection<T> collection, int itemIndex) {
			if (itemIndex > 0)
				collection.Move(itemIndex, itemIndex - 1);
		}
		public static void MoveUpDown<T>(this ObservableCollection<T> collection, int itemIndex) {
			if (itemIndex >= 0 && itemIndex < collection.Count - 1)
				collection.Move(itemIndex, itemIndex + 1);
		}
	}
}
